//封装导演模块相关接口


import myaxios from "../MyAxios"
import BASEURL from "../BaseUrl.js"
const BMDURL = BASEURL.BMDURL



const directorpApi = {

    //查询所有导演 ,返回Promise对象
queryAllDirector (){
    let url = BMDURL + "/movie-directors"
    return myaxios.get(url,{page:1,pagesize:100})
},

//通过姓名模糊查询导演列表,要传参
/**
 * 
 * @param {Object} params 请求参数对象
 * @return Promise
 */
queryByNameLike(params){
    let url = `${BMDURL}/movie-directors/name`
    return myaxios.post(url,params)
},

/**
 * @param {Object} params 参数对象
 * @return Promise
 */
//新增导演
add(){
    let url =  BMDURL + "/movie-director/add"
    return myaxios.post(url,params)

},

/**
 * @param {Object} params 参数对象 {id:导演id}
 * @return Promise
 * 
 */
//删除导演
delete(params){
    let url =  BMDURL + "/movie-director/del"
    return myaxios.post(url,params)

}
}

export default directorpApi